﻿@{
    ViewBag.Title = "List";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
 
@Styles.Render("~/Content/EasyUI/themes/bootstrap/easyui.css") 
@Styles.Render("~/Content/EasyUI/themes/icon.css") 
@Scripts.Render("~/Content/EasyUI/jquery.easyui.min.js") 
@Scripts.Render("~/Content/EasyUI/locale/easyui-lang-zh_CN.js")
<script>
    $(function() { 
        $.ajax({
            url: '@Url.Action("GetCaiXi")',
            type: 'Post',
            dataType: 'json',
            success: function (result) { 
                if (result == null)
                    return; 
                $.each(result.Data, function (index, row) {
                    var template = $('#caixilist').html(); //获取模版的html
                    var bookData = Mustache.render(template, row);//把每行的数据填充到模版得到html内容
                    $("#caixi").append(bookData);
                });
            }
        });
        $.ajax({
            url: '@Url.Action("GetHotHotel")',
            type: 'Post',
            dataType: 'json',
            success: function (result) {
                $("#hothotelol").html('');
                $.each(result.Data, function (index, row) {
                    row.i = index + 1;
                    var template = $('#hothotel').html(); //获取模版的html
                    var bookData = Mustache.render(template, row);//把每行的数据填充到模版得到html内容
                    $("#hothotelol").append(bookData);
                });
            }
        })
        $.ajax({
            url: '@Url.Action("GetCommendHotel")',
              type: 'Post',
              dataType: 'json',
              success: function (result) {
                  $("#commendhotelol").html('');
                  $.each(result.Data, function (index, row) {
                      row.i = index + 1;
                      var template = $('#commendhotel').html(); //获取模版的html
                      var bookData = Mustache.render(template, row);//把每行的数据填充到模版得到html内容
                      $("#commendhotelol").append(bookData);
                  });
              }
          })
        @Html.Raw(ViewBag.stcript);
    }); 
    //加载列表
    function OnSuccess(response) {
        // alert(response.Data); 
        $("#hotelOL").html('');
        if (response.Data == null)
            return; 

        $('#pp').pagination({
            total: response.TotalPage,
            pageSize: 10,
            onSelectPage: function (pageNumber, pageSize) {
                $(this).pagination('loading');
               alert('pageNumber:'+pageNumber+',pageSize:'+pageSize);
              
                $(this).pagination('loaded');
            }
        });


        $.each(response.Data, function (index, row) {
            var template = $('#hotellist').html(); //获取模版的html
            var bookData = Mustache.render(template, row);//把每行的数据填充到模版得到html内容
            $("#hotelOL").append(bookData);
        });
    }
    

    function SetCategory(parameters) {
      
        $("#category").val(parameters); 
        $("#schbtn").submit();
    }
</script>

<div id="content">
	<h1 class="h1a">本地商户</h1>
	<div id="mainContent">
		<div class="flt1">
			<dl id="caixi">
			    <dt>餐饮美食</dt> 
                   <dd><a href="#" onclick="SetCategory('')">全部</a></dd>    
			    <script type="text/template" id="caixilist">
                <dd><a href="#" onclick="SetCategory('{{DictName}}')">{{DictName}}</a></dd>    
                </script>
			</dl>
			@*<dl>
				<dt>商圈</dt>
				<dd><a href="./">浦东新区</a>(2213)</dd>
				<dd><a href="./">闵行区</a>(2213)</dd>
				<dd><a href="./">徐汇区</a>(2213)</dd>
				<dd><a href="./">普陀区</a>(2213)</dd>
				<dd><a href="./">长宁区</a>(2213)</dd>
				<dd><a href="./">粤菜馆</a>(2213)</dd>
				<dd><a href="./">杨浦区</a>(2213)</dd>
				<dd><a href="./">火锅</a>(2213)</dd>
				<dd><a href="./">虹口区</a>(2213)</dd>
				<dd><a href="./">宝山区</a>(2213)</dd>
				<dd><a href="./">黄浦区</a>(2213)</dd>
				<dd><a href="./">嘉定区</a>(2213)</dd>
				<dd><a href="./">本帮菜</a>(2213)</dd>
				<dd><a href="./">松江区</a>(2213)</dd>
			</dl>*@
		</div>
		<div class="flt2">
			<dl>
				<dd>默认
					<input type="text" name="keywords" class="w150" />
				</dd>
				<dd>人均：
					<input type="text" name="money1" class="w50" />
					-
					<input type="text" name="money2" class="w50" />
				</dd>
				<dd>排序：
					<select size="1">
						<option>默认</option>
						<option>热度</option>
						<option>评价数</option>
						<option>好评率</option>
						<option>人均↓</option>
						<option>人均↑</option>
					</select>
				</dd>
			</dl>
		</div>
	    <div class="mainhotellist">
	         <script type="text/template" id="hotellist">
		        <li>
		            <div class="mainimg"><img src="../{{Img}}" alt="{{Name}}" /></div>
		            <h3>{{Name}}</h3>
		            <dl class="score">
		                <dd>服务：<b>5</b></dd>
		                <dd>口味：<b>5</b></dd>
		                <dd>环境：<b>5</b></dd>
		                <dd>性价比：<b>5</b></dd>
		            </dl>
		            <div class="agvmoney">人均：<strong>￥{{Renjun}}</strong></div>
		            <div class="hoepie">好评：<i>{{Pingfen}}</i>(100)</div>
		            <div class="add">地址：{{Address}}</div>
		            <div class="htllabel">标签：拍黄瓜 水煮牛犊 椰汁 王老吉 小炒肉</div>
		            <p class="destine"><a href="/Store/Index/{{Id}}">预定</a></p></li>
		      </script>
	        <ol id="hotelOL">
		       
	        </ol>
	        <div class="page-wrap">
	               <div id="pp" style="background:#efefef;border:1px solid #ccc;"></div>
	        </div>
	    </div>
	</div>
	<div id="sideContent">
		<div class="sechothotel">
			<h2>热卖食府</h2>
              <script type="text/template" id="hothotel">
                <li class="li"><strong class="ordrid">{{i}}</strong>
				    <div class="mainimg"><img src="{{Img}}" alt="{{Name}}" /></div>
				    <h3><a href="/Store/Index/{{Id}}" title="{{Name}}" >{{Name}}</a></h3>
				    <div class="agvmoney">人均：<b>￥{{Renjun}}</b></div>
				    <div class="hoepie">已售出111份</div>
				</li>
                </script>
			<ol id="hothotelol"> 
			</ol>
		</div>
		<div class="sechothotel">
			<h2>推荐餐厅</h2>
            <script type="text/template" id="commendhotel">
                <li class="li"><strong class="ordrid">{{i}}</strong>
				    <div class="mainimg"><img src="{{Img}}" alt="{{Name}}" /></div>
				    <h3><a href="/Store/Index/{{Id}}" title="{{Name}}" >{{Name}}</a></h3>
				    <div class="agvmoney">人均：<b>￥{{Renjun}}</b></div>
				    <div class="hoepie">已售出111份</div>
				</li>
                </script>
			<ol id="commendhotelol"> 
			</ol>
		</div>
	</div>
</div>